<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
<h1> User表分页 </h1>

<table border="1">
    <tr>
        <td>ID</td>
        <td>入库时间</td>
        <td>用户名</td>
        <td>密码</td>
    </tr>
    <tr th:each="user:${list}">
        <td th:text="${user.id}">ID</td>
        <td th:text="${#dates.format(user.addTime,'yyyy-MM-dd HH:mm:ss')}">入库时间</td>
        <td th:text="${user.userName}">用户名</td>
        <td th:text="${user.password}">密码</td>
    </tr>
    <tr>
        <td colspan="4">
            <a th:href="@{/user/list}">首页</a>
            <a th:href="@{/user/list(current=${(current - 1) > 0 ? current - 1 : 1})}">上一页</a>
            <a th:href="@{/user/list(current=${(current + 1) < pages ? current + 1:pages})}">下一页</a>
            <a th:href="@{/user/list(current=${pages})}" >尾页</a>
        </td>
    </tr>
</table>

</body>

</html>